<?php
namespace app\demo\controller;

use app\BaseController;
use app\common\business\Demo;
class My extends BaseController
{
	public function index(){
		$cat_id = $this->request->param('cat_id',0,'intval');
		if(empty($cat_id)){
			return show(config('status.error'),'参数错误');
		}
		// 实例化业务层 调用根据cat_id获取数据
		$obj = new Demo();
		$result = $obj->getDemoDataByCatId($cat_id);

		return show(config('status.success'),'ok',$result);
	}

	public function fresh(){
		dump($this->request->type);
		dump('world');
	}
}